<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AppendTypeToRechargeRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('recharge_record', function (Blueprint $table) {
            //
            $table->tinyInteger('type')->default(0)->comment('充值类型 0 小程序充值 1 后台充值 more:小程序充值');
            $table->double('amount')->default(0)->comment('充值前金额 more:0');
            $table->double('after_price')->default(0)->comment('充值后金额 more:0');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('recharge_record', function (Blueprint $table) {
            //
            $table->dropColumn(['type','amount','after_price']);
        });
    }
}
